package com.qianli.user.enums;

/**
 * User: zhangxingyun
 * Date: 2017-07-23
 * Time: 14:10:22.383
 * Desc: 人脸识别类型:阿里（芝麻），其他
 */
public enum FaceRecognitionTypeEnum {

    ALI_RECONGNITION(1, "ALI_RECONGNITION"),
    OTHER_RECONGNITION(2, "OTHER_RECONGNITION");

    private Integer type;

    private String desc;

    FaceRecognitionTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public FaceRecognitionTypeEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public FaceRecognitionTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static FaceRecognitionTypeEnum getEnumByType(Integer type) {
        FaceRecognitionTypeEnum platformEnum = null;

        for (FaceRecognitionTypeEnum platformEnum1 : FaceRecognitionTypeEnum.values()) {
            if (platformEnum1.getType().equals(type)) {
                platformEnum = platformEnum1;
            }
        }

        return platformEnum;
    }
    
    public static FaceRecognitionTypeEnum getEnumByDesc(String desc) {
        FaceRecognitionTypeEnum platformEnum = null;
        for (FaceRecognitionTypeEnum enumObj : FaceRecognitionTypeEnum.values()) {
            if (enumObj.getDesc().equals(desc)) {
                platformEnum = enumObj;
                break;
            }
        }
        return platformEnum;
    }
}

